
package com.netease.xone.adapter;

import protocol.meta.InfoPraise;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.netease.framework.widget.LinkedListAdapter;
import com.netease.xone.R;
import com.netease.xone.itemview.RenderDetailPraiseView;

public class AdapterInfoPraise extends LinkedListAdapter<InfoPraise> {

    private Context mContext;

    public AdapterInfoPraise(Context context) {
        mContext = context;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        RenderDetailPraiseView render = null;
        
        if (null == convertView) {
            convertView = View.inflate(mContext, R.layout.item_view_detail_praise, null);
            render = new RenderDetailPraiseView(convertView);
            convertView.setTag(render);
        }
        
        render = (RenderDetailPraiseView)convertView.getTag();
        render.renderView(mContext, getItem(position), getCount()-1 == position);
        
        return convertView;
    }

}
